package com.cc.bsp.persistence.content;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;

public class PersistenceContent implements BeanFactoryAware {

	private static BeanFactory beanFactory;

	private static PersistenceContent instance = null;

	private PersistenceContent() {

	}

	public PersistenceContent getInstance() {
		if (instance == null) {
			instance = (PersistenceContent) beanFactory.getBean("applicationContent");
		}
		return instance;
	}

	public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
		PersistenceContent.beanFactory = beanFactory;
	}

	public static BeanFactory getBeanFactory() {
		return beanFactory;
	}

}
